<template>
  <el-container>
    <!--   导航栏   -->
    <el-header>
      <NavigationBar></NavigationBar>
    </el-header>
    <el-container>
      <!--    左侧边栏    -->
      <el-aside >
        <LiftBar></LiftBar>
      </el-aside>
      <el-container>
        <!--    主体      -->
        <el-main>
          <router-view :key="$route.path"></router-view>
        </el-main>
        <!--    底部标签      -->
        <el-footer>
          <Footer></Footer>
        </el-footer>
      </el-container>
    </el-container>
  </el-container>
</template>

<script lang="ts">
import {defineComponent} from 'vue';
import NavigationBar from "./home/NavigationBar.vue"
import LiftBar from "./home/LiftBar.vue"
import Footer from "./home/Footer.vue"
import LoginRequest from "@/utils/login";
import route from "@/router";
export default defineComponent({
  name: 'Home',
  components:{
    NavigationBar,
    LiftBar,
    Footer,
  },
  setup(){
    const isLogin = () => {
      if (!LoginRequest.isLogin())
      {
        route.push({path:'/Login',})
      }
    }
    return {
      isLogin
    }
  },
  beforeCreate() {
    this.isLogin()

  }
});
</script>
<style>
.el-header {
  background-color: #b3c0d1;
  color: var(--el-text-color-primary);
  text-align: center;
  height: 100px;
}
.el-footer {
  background-color: #b3c0d1;
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: var(--el-text-color-primary);
  text-align: center;
  width:200px
}

.el-main {
  background-color: #e9eef3;
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 160px;
  height: 700px;
}

</style>
